<div class="modal-header">
    <h3 class="modal-title">Kubernetes集群信息</h3>
</div>
<div class="modal-body">
    <form class="bs-example form-horizontal">
        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>集群名称</label>
                <div class="col-lg-8">
                    <input type="text" class="form-control" placeholder="集群名称" required
                           ng-model="cluster.name">
                </div>
            </div>

            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>环境类型</label>
                <div class="col-lg-8">
                    <select class="form-control" ng-model="cluster.env"
                            ng-options="envItem.code as envItem.name for envItem in envType" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-2 control-label">描述</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" placeholder="description" ng-model="cluster.description">
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>MasterUrl</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" placeholder="管理URL" ng-model="cluster.masterUrl">
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>KubeConfig</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" placeholder="kubeConfig文件路径" ng-model="cluster.kubeconfigFile">
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>命名空间</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" placeholder="namespace:用,分割" ng-model="cluster.namespace">
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>绑定服务器组</label>
                <div class="col-lg-8">
                    <ui-select ng-model="nowServerGroup.selected" theme="bootstrap"
                               ng-change="changeServerGroup(nowServerGroup.selected)">>
                        <ui-select-match placeholder="搜索服务器组名称......">{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices refresh="queryServerGroup($select.search)" refresh-dalay="0"
                                           repeat="item in serverGroupList | filter: $select.search">
                            <div ng-bind-html="item.name | highlight: $select.search"></div>
                        </ui-select-choices>
                    </ui-select>
                </div>
            </div>
            <button ng-click="removeServerGroup()"
                    class="btn btn-xs"
                    style="margin-top: 5px; background-color: #ff8700; color: white;">
                <span class="glyphicon glyphicon-remove"></span>移除
            </button>
        </div>




        <div class="form-group">
            <div style="text-align:center;">
                <!--保存-->
                <button ng-click="saveCluster()"
                        class="btn btn-xs"
                        style="background-color: #2e6da4; color: white;">
                    <span class="glyphicon glyphicon-ok"></span>保存
                </button>

                <button class="btn btn-xs"
                        style="margin-left: 5px; background-color: #ff8700; color: white;"
                        ng-click="closeModal()">关闭
                </button>

            </div>
        </div>
    </form>
    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>